package com.test.model;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;

/**
 *
 * @author zxw
 * create 2016年3月7日 下午1:53:17
 */
@Entity
@Table(name="rcc_e_buildValve")
public class BuildValve extends EquModel{
   private Integer uniqueId;
   private String serialNo;
   private Integer caliber;
   private Model model;
    private NetEqu netEqu;
   private Collector collector;
   private Integer port;
   private Integer index;
   private Date installDate;
   private Date createDate;
   private Unit unit;
   private Build build;
   private StationBranch stationBranch;
   private String memo;
   private String detailPosition;
    private BigDecimal kp;
    private  BigDecimal highOpening;
    private BigDecimal lowOpening;
//   private Set<BuildValveCurrentAlarm> buildValveCurrentAlarm;
//   private Set<BuildValveCurrentFault> buildValveCurrentFault;
//    private Set<BuildValveHistoricalAlarm> buildValveHistoricalAlarm;
//    private Set<BuildValveHistoricalFault> buildValveHistoricalFault;
    private Set<BuildValveCurrentData> buildValveCurrentData;

   @Id
   @GeneratedValue
   @Column(name = "uniqueId", unique = true, nullable = false)
   public Integer getUniqueId() {
       return uniqueId;
   }
   public void setUniqueId(Integer uniqueId) {
       this.uniqueId = uniqueId;
   }
    @Column(name = "serialNo")
   public String getSerialNo() {
       return serialNo;
   }
   public void setSerialNo(String serialNo) {
       this.serialNo = serialNo;
   }
    @Column(name = "caliber")
   public Integer getCaliber() {
       return caliber;
   }
   public void setCaliber(Integer caliber) {
       this.caliber = caliber;
   }
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "modelId")
   public Model getModel() {
       return model;
   }
   public void setModel(Model model) {
       this.model = model;
   }
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "collectorId")
   public Collector getCollector() {
       return collector;
   }
   public void setCollector(Collector collector) {
       this.collector = collector;
   }
    @Column(name = "`port`")
   public Integer getPort() {
       return port;
   }
   public void setPort(Integer port) {
       this.port = port;
   }
    @Column(name = "`index`")
   public Integer getIndex() {
       return index;
   }
   public void setIndex(Integer index) {
       this.index = index;
   }
   @Column(name = "installDate")
   public Date getInstallDate() {
       return installDate;
   }
   public void setInstallDate(Date installDate) {
       this.installDate = installDate;
   }
    @Column(name = "createDate")
   public Date getCreateDate() {
       return createDate;
   }
   public void setCreateDate(Date createDate) {
       this.createDate = createDate;
   }
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "unitId")
   public Unit getUnit() {
       return unit;
   }
   public void setUnit(Unit unit) {
       this.unit = unit;
   }
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "stationBranchId")
   public StationBranch getStationBranch() {
       return stationBranch;
   }
   public void setStationBranch(StationBranch stationBranch) {
       this.stationBranch = stationBranch;
   }
   @Column(name = "memo")
   public String getMemo() {
       return memo;
   }
   public void setMemo(String memo) {
       this.memo = memo;
   }
    @Column(name = "detailPosition")
   public String getDetailPosition() {
       return detailPosition;
   }
   public void setDetailPosition(String detailPosition) {
       this.detailPosition = detailPosition;
   }
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "netEquId")
    public NetEqu getNetEqu() {
        return netEqu;
    }

    public void setNetEqu(NetEqu netEqu) {
        this.netEqu = netEqu;
    }

//    @OneToMany(mappedBy = "buildValve")
//   public Set<BuildValveCurrentAlarm> getBuildValveCurrentAlarm() {
//       return buildValveCurrentAlarm;
//   }
//   public void setBuildValveCurrentAlarm(Set<BuildValveCurrentAlarm> buildValveCurrentAlarm) {
//       this.buildValveCurrentAlarm = buildValveCurrentAlarm;
//   }
//
//   @OneToMany(mappedBy = "buildValve")
//   public Set<BuildValveCurrentFault> getBuildValveCurrentFault() {
//       return buildValveCurrentFault;
//   }
//   public void setBuildValveCurrentFault(Set<BuildValveCurrentFault> buildValveCurrentFault) {
//       this.buildValveCurrentFault = buildValveCurrentFault;
//   }
//
//
//    @OneToMany(mappedBy = "buildValve")
//    public Set<BuildValveHistoricalAlarm> getBuildValveHistoricalAlarm() {
//        return buildValveHistoricalAlarm;
//    }
//
//    public void setBuildValveHistoricalAlarm(Set<BuildValveHistoricalAlarm> buildValveHistoricalAlarm) {
//        this.buildValveHistoricalAlarm = buildValveHistoricalAlarm;
//    }
//
//    @OneToMany(mappedBy = "buildValve")
//    public Set<BuildValveHistoricalFault> getBuildValveHistoricalFault() {
//        return buildValveHistoricalFault;
//    }
//
//    public void setBuildValveHistoricalFault(Set<BuildValveHistoricalFault> buildValveHistoricalFault) {
//        this.buildValveHistoricalFault = buildValveHistoricalFault;
//    }


    @OneToMany(mappedBy = "buildValve")
   public Set<BuildValveCurrentData> getBuildValveCurrentData() {
       return buildValveCurrentData;
   }
   public void setBuildValveCurrentData(Set<BuildValveCurrentData> buildValveCurrentData) {
       this.buildValveCurrentData = buildValveCurrentData;
   }
   @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "buildId")
   public Build getBuild() {
       return build;
   }
   public void setBuild(Build build) {
       this.build = build;
   }

    @Column(name = "kp")
    public BigDecimal getKp() {
        return kp;
    }

    public void setKp(BigDecimal kp) {
        this.kp = kp;
    }
//	 @Column(name = "highOpening")
//	 public BigDecimal getHightOpening() {
//		 return hightOpening;
//	 }
//
//	 public void setOpeningMax(BigDecimal openingMax) {
//		 this.openingMax = openingMax;
//	 }
//	 @Column(name = "lowOpening")
//	 public BigDecimal getOpeningMin() {
//		 return openingMin;
//	 }
//
//	 public void setOpeningMin(BigDecimal openingMin) {
//		 this.openingMin = openingMin;
//	 }

    @Column(name = "lowOpening")
    public BigDecimal getLowOpening() {
        return lowOpening;
    }

    public void setLowOpening(BigDecimal lowOpening) {
        this.lowOpening = lowOpening;
    }

    @Column(name = "highOpening")
    public BigDecimal getHighOpening() {
        return highOpening;
    }

    public void setHighOpening(BigDecimal highOpening) {
        this.highOpening = highOpening;
    }
}
